package com.yb.designpattern.creation.factory.simple;

import com.yb.designpattern.creation.factory.Audi;
import com.yb.designpattern.creation.factory.Benz;
import com.yb.designpattern.creation.factory.Bmw;
import com.yb.designpattern.creation.factory.Car;

public class CarFactory {
	public static Car createCar(String car){
		Car c = null;
		if ("Benz".equalsIgnoreCase(car)) {
			c = new Benz();
		}else if ("Audi".equalsIgnoreCase(car)) {
			c = new Audi();
		}else if ("Bmw".equalsIgnoreCase(car)) {
			c = new Bmw();
		}
		return c;
	}
}
